import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description 日历
 * @author 何文俊
 * @date 2023-12-06
 */
@Mapper
@Repository
public interface RiLiMapper {
    @Select("SELECT dept, \"yearMonth\", holidays FROM rili  where  \"yearMonth\" = #{yearMonth} and dept = #{dept}")
    RiLi getByYearMonthAndDept(RiLi rili);

    @Insert("INSERT INTO rili (dept, \"yearMonth\", holidays) VALUES( #{dept}, #{yearMonth}, #{holidays})")
    Integer insert(RiLi rili);

    @Update("UPDATE rili SET dept=#{dept}, \"yearMonth\"= #{yearMonth}, holidays=#{holidays} where \"yearMonth\" = #{yearMonth} and dept = #{dept}")
    boolean update(RiLi rili);

}